class Solution {
public:
    string largestNumber(vector<int>& nums) {
        vector<string> tmp;
        string ret;
        for(auto& ch:nums)
            tmp.push_back(to_string(ch));

        sort(tmp.begin(),tmp.end(),[&](const string& a,const string& b)
        {
            return a+b>b+a;
        });
        for(auto& ch:tmp)
            ret+=ch;
        if(tmp[0]=="0") return "0";
        return ret;
    }
};
